package cn.wetcland.urban.framework.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.wetcland.urban.common.AjaxResponse;
import cn.wetcland.urban.framework.annotation.SaCheckDriverLogin;
import cn.wetcland.urban.framework.service.UtSwiperService;
import cn.wetcland.urban.framework.vo.SwiperListItemVO;
import org.springframework.aop.aspectj.AbstractAspectJAdvice;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/swiper")
public class SwiperController {

    @Resource
    public UtSwiperService swiperService;

    @SaCheckLogin
    @GetMapping("/customerHomeSwiper")
    public AjaxResponse customerHomeSwiper() {
        List<SwiperListItemVO> swiperListItemVOS = swiperService.customerHomeSwiper();
        return AjaxResponse.success(swiperListItemVOS);
    }

    @SaCheckDriverLogin
    @GetMapping("/driverHomeSwiper")
    public AjaxResponse driverHomeSwiper() {
        List<SwiperListItemVO> swiperListItemVOS = swiperService.driverHomeSwiper();
        return AjaxResponse.success(swiperListItemVOS);
    }

}
